package com.example.demo_dongruanD.controller;

import com.example.demo_dongruanD.dto.InsertCiDetailedReportRequest;
import com.example.demo_dongruanD.response.ApiResponse;
import com.example.demo_dongruanD.service.SetMealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 处理与CiDetailedReport相关的HTTP请求，包括插入详细报告的请求
 */
@RestController
@RequestMapping("/cd")
public class CiDetailedReportController {

    @Autowired
    private SetMealService setMealService;

    /**
     * 插入详细报告的请求处理，是各个检查项的各个检查细节的数据的保存
     * @param request 包含orderId、cdIds和values的请求对象
     * @return ApiResponse 插入结果的ApiResponse对象
     */
        @PostMapping("/reportinsert")
    public ApiResponse<String> insertCiDetailedReport(@RequestBody InsertCiDetailedReportRequest request) {
        return setMealService.insertCiDetailedReport(request);
    }
}
